package gui.utils;

import java.util.ArrayList;

import javax.swing.DefaultComboBoxModel;

public class UnsubscribeComboBoxModel extends DefaultComboBoxModel {

	private static final long serialVersionUID = 1L;
	private ArrayList<String> subscribedTopics;

	public UnsubscribeComboBoxModel(ArrayList<String> topics) {
		super();
		subscribedTopics = topics;
		refresh();
	}

	// Creating the list of topics into the comboBoxModel
	public final void refresh() {
		this.addElement("");
		for (String topic : subscribedTopics)
			this.addElement(topic);
	}
}
